﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NerdDinner.Data.Entities;
using System.Web.Mvc;

namespace NerdDinner.ViewData
{
    public class WalkItemViewData
    {
        public Walk Walk{ get; set;}

        public SelectList Categories { get; set; }

        public SelectList TimeValue
        {
            get {return getTimeVlues();}
        }

        private SelectList getTimeVlues()
        {
            List<string> list = new List<string>(); 
            
            for (int i = 0; i < 24; i++)
            {
                string item = (i< 10 ? "0" + i.ToString() : i.ToString());
                list.Add(item  + ":00");
                list.Add(item + ":30");
            }
            SelectList selectList = new SelectList(list, list[24]);
            return selectList;
        }

        public WalkItemViewData()
            : base()
        {
        }

        public WalkItemViewData(Walk walk) : base()
        {
            Walk = walk;
        }
        
        public WalkItemViewData(Walk walk, SelectList listCategory ) : this(walk)
        {
            Categories = listCategory;
        }
    }
}
